class RightAngledTriangle:
    def __init__(self, side_1: float, side_2: float, is_hypotenuse_not_given: bool):
        if is_hypotenuse_not_given:
            self._hypotenuse = (side_1 ** 2 + side_2 ** 2) ** 0.5
            self._short_side, self._long_side = sorted((side_1, side_2))
        else:
            side_a, self._hypotenuse = sorted((side_1, side_2))
            side_b = (abs(side_1 ** 2 - side_2 ** 2)) ** 0.5
            self._short_side, self._long_side = sorted((side_a, side_b))

    def short_side(self):
        return self._short_side

    def long_side(self):
        return self._long_side

    def hypotenuse(self):
        return self._hypotenuse

    def area(self):
        return self._short_side * self._long_side / 2

    def perimeter(self):
        return self._short_side + self._long_side + self._hypotenuse


def _main():
    hypotenuse = float(input("请输入直角三角形的斜边长："))
    right_angle_side = float(input("请再输入此直角三角形一条直角边长："))
    if right_angle_side >= hypotenuse or hypotenuse < 0 or right_angle_side < 0:
        print("斜边上应大于直角边长，且均为正数。请检查输入。")
        return
    triangle = RightAngledTriangle(hypotenuse, right_angle_side, False)
    sides = [f"{triangle.short_side():.2f}", f"{triangle.long_side():.2f}"]

    sides.remove(f"{right_angle_side:.2f}")
    assert len(sides) == 1
    result_side = sides[0]

    print("另一条直角边长为：", result_side, sep="")
    print(f"周长为：{triangle.perimeter():.2f}")
    print(f"面积为：{triangle.area():.2f}")


if __name__ == "__main__":
    _main()
